<template>
  <div id="app">
    <h3>案例：折叠面板</h3>
    <div>
      <div class="title">
        <h4>芙蓉楼送辛渐</h4>
        <span class="btn" @click="isShow = !isShow">
          {{ isShow ? "收起" : "展开" }}
        </span>
      </div>
      <div class="container" v-show="isShow">
        <p>寒雨连江夜入吴,</p>
        <p>平明送客楚山孤。</p>
        <p>洛阳亲友如相问，</p>
        <p>一片冰心在玉壶。</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: true,
    };
  },
};
</script>

<style lang="less">
body {
  background-color: #ccc;
  #app {
    background-color: #fff;
    width: 400px;
    margin: 0 auto;
    border: 4px solid #000;
    border-radius: 16px;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
    padding: 15px;
    h3 {
      text-align: center;
    }
    .title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid #ccc;
      padding-left: 15px;
    }
    .container {
      border: 1px solid #ccc;
      padding-left: 15px;
    }
    .btn {
      cursor: pointer;
    }
  }
}
</style>